<template>
  <div class="header">
    <span>西安</span>
    <van-search
      v-model="value"
      placeholder="请输入搜索关键词"
      background="#fd6664"
      autofocus
      shape="round"
    />
    <router-link to="/login" tag="span" v-if="!mytoken">登录</router-link>
    <router-link to="/mine" tag="span" v-if="mytoken">我的</router-link>
    <router-view></router-view>
  </div>
</template>

<script>
import Vue from "vue";
import { Search } from "vant";
Vue.use(Search);
export default {
  data() {
    return {
      value: "",
      mytoken:localStorage.getItem("token")
    };
  },
};
</script>

<style scoped>
.header {
  display: flex;
  color: white;
  background-color: #fd6664;
  /* border-bottom: #87cdec solid .03125rem; */
  justify-content: space-around;
  align-items: center;
}
</style>